package com.hzncc.scaffold.utils;

import cn.hutool.core.util.CharsetUtil;
import cn.hutool.crypto.Mode;
import cn.hutool.crypto.Padding;
import cn.hutool.crypto.symmetric.AES;

import java.util.Calendar;
import java.util.Date;
import java.util.UUID;

public class NumberUtils {
    public static Integer numAdd(Integer index) {
        Integer number = 0;
      if(null != index){
          return index+20;
      }else {
          return number;
      }
    }

    public static Integer pageNum(Integer page, Integer pageNum) {
        Integer pageData = 10;
        if(null != page){
            return page;
        }else if(null != pageNum){
            return  pageNum;
        }else {
            return pageData;
        }

    }

    public static String pad(int length,long num){
        return String.format("%0".concat(String.valueOf(length)).concat("d"), num);
    }

    public static void main(String[] args) {

            String answer = "dhzTu4XPT9mVLCBP4Lsp6LmyJUMJLa0HaEdcb17Lnn0CpUuXi17Eao9SCcuJaEeIYPOTqq5FuHhxZxEqNfp3vQf3KehgVHzV+pchy7IisFhJRu7ZkXw5DlRE+fupuCvJej7xVBbB8InI118EDYpiKvQwEypk3nDtRnJ4FzvGtovvWr2vZUeENevCCXGx4GFsUoVYJuG9I76exZWwO5ykEHkkzi0nquSYcPumlaRhG6EELW4CoHt+nVfSOU/cU26QEcY3G96sKV9QjVN/57tVfrKAgyxFHGU6GO2Ua92IE2SPxZABpBo63VTO8wmvnLuxW8we0NPHiU5qTptMkwzpuqw+208vrW98/XplLXYBnSixE0VAAVpy74TB/gZEbN5l8gJ6wpJfl1JXOUv7j8R1XQaYxWsGnY70WBYjvINKCuKjLsL436Bu7rlhLC1/oRZVKEgAvuoH8jA1xmHkkYTvd7YZ3JflXVa4t0qZFfQdI8s2KIr5Mb85Ab9KrOxRfYLGXKHKALgqQwGgUh6cSHQ1qNe+J2pla3bF+HS758Y041SSNgyU5D8PotLlTlcee7Ym241+deDGXCdozazZ46EI1YdtsJT8n7bdXm8DTQbw0qTPOX0QuQ2B2SOSAe2NBS0ElCXJfEKoT4jQPKVzOyQs1u9kEq5EkiLNdHL5w1YFHHupVdQSRMie8le6Dbn6I6+kuuNPPi//ilyRNiEYjNGto1rmUz6akpeRLtMCm7EkgJMFj0tUbeGhqpWQ0+N2wm8C/nJOz/5MguUCBVT3k2BZbTZDEUkZFiH1FYAJhGqSqW0nUSro6Ud8ShOHxfjViE3EW801J+n/0XtGcbZIt36eh0iaNHmwH0evRk4UOtRIuKz3a+dIA3URRQyI+XOtHnDbaUSZ5o+pg1YzzLIu+rKbLX7G51j1uEt2Fk8f0koNyRFjpfmi02JjwQxz2GXzVVDqJwhNbDNpakcHvCgdXen4EOgQoF1l1zQglUyD1/uv+wSCNLAo/+N1Fe9icCTyzk/iamFCKGW9qsOMkFVXZvTjn6TUdYSVMTI7Wdtwc++/ORzsRs9ACHx5gHVg6pdsqnTDL9OYOAuSwKVaeDo3i64uTfoI0jVeKlKX5+jCEbXU1jJhbAlpE2qhZZKMvP2A9VZhWFA/p/euPeaKsk3EK/lZUg8y5cu3yfYOBAFByHq4royrB0++lH/uVAFYZEuVqQSviDzQxx+2KooCkSOThNs5KwrGqj8aeqDii3RbdFDQMGCATDtO/2fn7GnVfL4dVpqecy5dTmBuzWoqmJuqPDzL8CAfSk5CQuyD/jsJB6AN9C7sjZbUqxSabLN1G83eGawrl1nUXXX9xT4GsC9KXnBQMTO0G1YVjUdC4/qUularGG8DgJn6OK99XIe7aN9WbyA+i9bT3tvDJQ86++C21tFJlkVN+EJMsCIgPn6tLixF00HrLdNO3hxzUop0r0UTtMiHNJbAa4q9UcZpm9MfZWLdNp4oiGE9CV/hRZUHA4Rtxog7NHh5t7RJ8ZOsSixex6duPCsXl/5tjsgi7jJfKQwD+mnJhkOi/XvpbYObNrq6cqRFVF2MoHk3RipgZnnLglVTmfKWt78UqELHekVEPG/FeIoNVxsC/C4E4GlvsOJFecA=";

        //AES解密
        AES aes = new AES(Mode.CBC, Padding.PKCS5Padding, "w2SIy2Hx%2i!tTCd-ikwHEv_kQmB58xI".getBytes(), "R7#54X&gLB!6Q&s=".getBytes());
        String decryptStr = aes.decryptStr(answer, CharsetUtil.CHARSET_UTF_8);
        System.out.println(decryptStr);
    }
}
